{include file="public/meta" /}
<title>编辑 - 奖金比例</title>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form-edit">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>业绩最小金额：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info['min']}" placeholder="输入业绩最小金额" id="min" name="min">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>业绩最大金额：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info['max']}" placeholder="输入业绩最大金额" id="max" name="max">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>奖金比例：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="{$info['ratio']}" placeholder="输入奖金比例" id="ratio" name="ratio">
            </div>
        </div>
        <input type="hidden" name="id" value="{$info['id']}">
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button onClick="form_edit();" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存提交</button>
                <button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>

</article>

<!--_footer 作为公共模版分离出去-->
{include file="public/footer" /}
<!--/_footer /作为公共模版分离出去-->

<script type="text/javascript">
    function form_edit(){
        var form = $("#form-edit").serializeArray();
        $.ajax({
            url:"{:url('System/edit')}",
            type:"post",
            data:form,
            dataType:"json",
            success:function(data){
                if(data.code==0) {
                    parent.layer.msg(data.msg,{icon:6,time:1000});
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.window.location.reload();
                    parent.layer.close(index);
                } else {
                    parent.layer.msg(data.msg,{icon:5,time:1000});
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
            },
            error:function(data){
                layer.msg('500系统错误，请联系管理员！',{icon:5,time:1000});
            }
        });
    }
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</head>

</html>